<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>{BEESCRM:$title}</title>
    <meta name="description" content="">
    <meta name="HandheldFriendly" content="True">
    <meta name="MobileOptimized" content="320">
    <meta name="viewport" content="width=device-width, initial-scale=1, minimal-ui, user-scalable=no">
    <meta http-equiv="cleartype" content="on">
    <meta name="format-detection" content="telephone=no">

    <if condition="$action_name eq 'index'">
        <link rel="stylesheet" href="/assets/store_zt/common/css/index.css?v={BEESCRM:$time}">
        <link rel="stylesheet" href="/assets/store_zt/common/css/swiper.min.css">
    <else/>
        <link rel="stylesheet" href="/assets/store_zt/common/css/css/index-417f765752.css">
        <link rel="stylesheet" href="/assets/store_zt/common/css/swiper.min.css">
    </if>

    <script src="http://res.wx.qq.com/open/js/jweixin-1.0.0.js"></script>
    <!--引入alipay jsAPI的功能js-->
    <script src="https://as.alipayobjects.com/g/component/antbridge/1.1.1/antbridge.min.js"></script>
    <script type="text/javascript">
        var browser = "{BEESCRM:$browser}";
        var url = '{BEESCRM:$share_url}';
        var imgUrl = '{BEESCRM:$share_image}';
        var title = '{BEESCRM:$share_title}';
        var desc = '{BEESCRM:$share_desc}';
        if(browser == 2) {
            AlipayJSBridge.call('setOptionMenu', {
                'icon':"{BEESCRM::C('site_url').'/assets/store_zt/images/alipay_option_icon10.png'}",
                'override':true
            });
            document.addEventListener('optionMenu', function () {
                if (navigator.userAgent.indexOf("AlipayClient") === -1) {
                    alert('请在支付宝钱包内运行');
                } else {
                    if ((Ali.alipayVersion).slice(0, 3) >= 8.1) {
                        Ali.share({
                            //渠道名称。支持以下几种：Weibo/LaiwangContacts/LaiwangTimeline/Weixin/WeixinTimeLine/SMS/CopyLink
                            'channels': [{
                                name: 'ALPContact',   //支付宝联系人,9.0版本
                                param: {   //请注意，支付宝联系人仅支持一下参数
                                    contentType: 'url',    //必选参数,目前支持支持"text","image","url"格式
                                    content: desc,    //必选参数,分享描述
                                    iconUrl: imgUrl,   //必选参数,缩略图url，发送前预览使用,
                                    imageUrl: imgUrl, //图片url
                                    url: url,   //必选参数，卡片跳转连接
                                    title: title,    //必选参数,分享标题
                                    memo: ""   //透传参数,分享成功后，在联系人界面的通知提示。
                                }
                            }, {
                                name: 'ALPTimeLine', //支付宝生活圈
                                param: {
                                    contentType: 'url',    //必选参数,目前只支持"url"格式
                                    title: title,   //标题
                                    url: url,  //url
                                    iconUrl: "https://i.alipayobjects.com/common/favicon/favicon.ico" //icon
                                }
                            }, {
                                name: 'Weibo', //新浪微博
                                param: {
                                    title: title,
                                    content: desc,
                                    imageUrl: imgUrl,
                                    captureScreen: true, //分享当前屏幕截图(和imageUrl同时存在时，优先imageUrl)
                                    url: url //分享跳转的url，当添加此参数时，分享的图片大小不能超过32K
                                }
                            }, {
                                name: 'Weixin', //微信
                                param: {
                                    title: title,
                                    content: desc,
                                    imageUrl: imgUrl,
                                    captureScreen: true,
                                    url: url
                                }
                            }, {
                                name: 'WeixinTimeLine', //微信朋友圈
                                param: {
                                    title: title,
                                    content: desc,
                                    imageUrl: imgUrl,
                                    captureScreen: true,
                                    url: url
                                }
                            }, {
                                name: 'SMS', //短信
                                param: {
                                    content: desc,
                                    //应业务方需求定制功能
                                    contentType: 'url',
                                    extData: ''
                                }
                            }, {
                                name: 'CopyLink', //复制链接
                                param: {
                                    url: url
                                }
                            }]
                        }, function (result) {
                            if (result.errorCode) {
                                //没有成功分享的情况
                                //errorCode=10，分享失败或取消

                            } else {
                                // 显示
                                AlipayJSBridge.call('toast', {
                                    content: '分享成功',
                                    type: 'success',
                                    duration: 2000
                                }, function(){});
                            }
                        });
                    } else {
                        Ali.alert({
                            title: '亲',
                            message: '请升级您的钱包到最新版',
                            button: '确定'
                        });
                    }
                }
            }, false);
        } else {
            wx.config({
                debug: false,
                appId: "{BEESCRM:$appid}",
                timestamp: "{BEESCRM:$timestamp}",
                nonceStr: "{BEESCRM:$noncestr}",
                signature: "{BEESCRM:$signature}",
                jsApiList: ['checkJsApi', 'onMenuShareTimeline', 'onMenuShareAppMessage', 'onMenuShareQQ', 'onMenuShareWeibo'],
            });
            wx.ready(function () {
                //分享到朋友圈
                wx.onMenuShareTimeline({
                    title: title, // 分享标题
                    link: url, // 分享链接
                    imgUrl: imgUrl, // 分享图标
                    success: function () {
                        share();
                    },
                    cancel: function () {
                        // 用户取消分享后执行的回调函数
                        /* alert('已取消'); */
                    }
                });
                //发送给好友
                wx.onMenuShareAppMessage({
                    title: title, // 分享标题
                    desc: desc, // 分享描述
                    link: url, // 分享链接
                    imgUrl: imgUrl, // 分享图标
                    success: function () {
                        // 用户确认分享后执行的回调函数
                        //share();
                    },
                    cancel: function () {
                        // 用户取消分享后执行的回调函数
                    }
                });
            });
        }
    </script>
</head>
<body>
<div class="scrm-loadding">
    <svg width="95" height="20" id="gb-loading">
        <rect width="20" height="20" x="0" y="0" rx="3" ry="3">
            <animate attributeName="width" values="0;20;20;20;0" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="height" values="0;20;20;20;0" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="x" values="10;0;0;0;10" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="y" values="10;0;0;0;10" dur="1000ms" repeatCount="indefinite"/>
        </rect>
        <rect width="20" height="20" x="25" y="0" rx="3" ry="3">
            <animate attributeName="width" values="0;20;20;20;0" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="height" values="0;20;20;20;0" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="x" values="35;25;25;25;35" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="y" values="10;0;0;0;10" begin="200ms" dur="1000ms" repeatCount="indefinite"/>
        </rect>
        <rect width="20" height="20" x="50" y="0" rx="3" ry="3">
            <animate attributeName="width" values="0;20;20;20;0" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="height" values="0;20;20;20;0" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="x" values="60;50;50;50;60" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="y" values="10;0;0;0;10" begin="400ms" dur="1000ms" repeatCount="indefinite"/>
        </rect>
        <rect width="20" height="20" x="75" y="0" rx="3" ry="3">
            <animate attributeName="width" values="0;20;20;20;0" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="height" values="0;20;20;20;0" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="x" values="85;75;75;75;85" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
            <animate attributeName="y" values="10;0;0;0;10" begin="800ms" dur="1000ms" repeatCount="indefinite"/>
        </rect>
    </svg>
</div>

